package com.mingte.manghe.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.mingte.manghe.dao.LaborInformationEntityMapper;
import com.mingte.manghe.dao.other.LaborInformationOtherEntityMapper;
import com.mingte.manghe.entity.LaborInformationEntity;
import com.mingte.manghe.entity.LaborInformationEntityExample;
import com.mingte.manghe.service.LaborInformationService;


/**
 * 学生课时操作记录表-实现类
 *
 * @author luxinsheng
 * @email sheng_xin_lu@163.com
 * @date 
 */
@Service
public class LaborInformationServiceImpl implements LaborInformationService {

	private final Logger logger = LoggerFactory.getLogger(LaborInformationServiceImpl.class);

	@Autowired
	private LaborInformationEntityMapper laborInformationEntityMapper;

	@Autowired
	private LaborInformationOtherEntityMapper laborInformationOtherEntityMapper;


	/**
	 * 查询学生课时操作记录表,通过id
	 * @return
	 */
	@Override
	public LaborInformationEntity queryObject(Long id){

		return laborInformationEntityMapper.selectByPrimaryKey(id);
	}

	/**
	 * 查询学生课时操作记录表列表,通过多项条件
	 * @return
	 */
	@Override
	public List<LaborInformationEntity> queryList(Map<String, Object> map){

		LaborInformationEntityExample example = new LaborInformationEntityExample();
		example.createCriteria();
		//添加剩余的条件

		return laborInformationEntityMapper.selectByExample(example);
	}

	/**
	 * 查询学生课时操作记录表总数,通过多项条件
	 * @return
	 */
	@Override
	public int queryTotal(Map<String, Object> map){

		return laborInformationOtherEntityMapper.queryTotal(map);
	}

	/**
	 * 保存学生课时操作记录表
	 * @return
	 */
	@Override
	public int save(LaborInformationEntity laborInformation){
		return	laborInformationEntityMapper.insert(laborInformation);
	}

	/**
	 * 修改学生课时操作记录表
	 * @return
	 */
	@Override
	public int update(LaborInformationEntity laborInformation){

		return	laborInformationEntityMapper.updateByPrimaryKeySelective(laborInformation);
	}

	/**
	 * 删除学生课时操作记录表,通过id
	 * @return
	 */
	@Override
	public int delete(Long id){

		return	laborInformationEntityMapper.deleteByPrimaryKey(id);
	}

	/**
	 * 批量删除学生课时操作记录表,通过ids
	 * @return
	 */
	@Override
	public int deleteBatch(Long[] ids){

		return	laborInformationOtherEntityMapper.deleteBatch(ids);
	}
	
}
